﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;

namespace WindowsFormsApplication1
{
    
    [Serializable]
    [XmlRoot("Hardwares")]
    public class Hardwares
    {
        private List<HardwareProfile> _profile;

        [XmlArrayItem("HardwareProfiles", typeof(HardwareProfile))]
        [XmlArray("Profile")]
        public List<HardwareProfile> Profile
        {
            get { return _profile; }
            set { _profile = value; }
        }

        public Hardwares() 
        {
            Profile = new List<HardwareProfile>();
        }
    }

    [Serializable]
    [XmlRoot("Hardware")]
    public class HardwareProfile
    {
        private string _name;

        [XmlElement()]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        private string _uploadPotocal;

        [XmlElement()]
        public string UploadPotocal
        {
            get { return _uploadPotocal; }
            set { _uploadPotocal = value; }
        }
        private string _uploadMaximum;

        [XmlElement()]
        public string UploadMaximum
        {
            get { return _uploadMaximum; }
            set { _uploadMaximum = value; }
        }
        private string _uploadSpeed;

        [XmlElement()]
        public string UploadSpeed
        {
            get { return _uploadSpeed; }
            set { _uploadSpeed = value; }
        }
        private string _mcu;

        [XmlElement()]
        public string Mcu
        {
            get { return _mcu; }
            set { _mcu = value; }
        }
        private string _fcpu;

        [XmlElement()]
        public string Fcpu
        {
            get { return _fcpu; }
            set { _fcpu = value; }
        }
        private string _core;

        [XmlElement()]
        public string Core
        {
            get { return _core; }
            set { _core = value; }
        }

        public HardwareProfile()
        {

        }

        public override string ToString()
        {
            return this.Name;
        }
    }
}
